Optimal. Leaf size=150 \[ \frac {5 a^4 (A+2 B) \sin (c+d x)}{2 d}+\frac {a^4 (4 A+B) \tanh ^{-1}(\sin (c+d x))}{d}-\frac {(3 A-8 B) \sin (c+d x) \left (a^4 \cos (c+d x)+a^4\right )}{6 d}+\frac {1}{2} a^4 x (13 A+12 B)-\frac {(3 A-B) \sin (c+d x) \left (a^2 \cos (c+d x)+a^2\right )^2}{3 d}+\frac {a A \tan (c+d x) (a \cos (c+d x)+a)^3}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.45, antiderivative size = 150, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.194, Rules used = {2975, 2976, 2968, 3023, 2735, 3770} \[ \frac {5 a^4 (A+2 B) \sin (c+d x)}{2 d}+\frac {a^4 (4 A+B) \tanh ^{-1}(\sin (c+d x))}{d}-\frac {(3 A-B) \sin (c+d x) \left (a^2 \cos (c+d x)+a^2\right )^2}{3 d}-\frac {(3 A-8 B) \sin (c+d x) \left (a^4 \cos (c+d x)+a^4\right )}{6 d}+\frac {1}{2} a^4 x (13 A+12 B)+\frac {a A \tan (c+d x) (a \cos (c+d x)+a)^3}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2735
Rule 2968
Rule 2975
Rule 2976
Rule 3023
Rule 3770
Rubi steps
\begin {align*} \int (a+a \cos (c+d x))^4 (A+B \cos (c+d x)) \sec ^2(c+d x) \, dx &=\frac {a A (a+a \cos (c+d x))^3 \tan (c+d x)}{d}+\int (a+a \cos (c+d x))^3 (a (4 A+B)-a (3 A-B) \cos (c+d x)) \sec (c+d x) \, dx\\ &=-\frac {(3 A-B) \left (a^2+a^2 \cos (c+d x)\right )^2 \sin (c+d x)}{3 d}+\frac {a A (a+a \cos (c+d x))^3 \tan (c+d x)}{d}+\frac {1}{3} \int (a+a \cos (c+d x))^2 \left (3 a^2 (4 A+B)-a^2 (3 A-8 B) \cos (c+d x)\right ) \sec (c+d x) \, dx\\ &=-\frac {(3 A-B) \left (a^2+a^2 \cos (c+d x)\right )^2 \sin (c+d x)}{3 d}-\frac {(3 A-8 B) \left (a^4+a^4 \cos (c+d x)\right ) \sin (c+d x)}{6 d}+\frac {a A (a+a \cos (c+d x))^3 \tan (c+d x)}{d}+\frac {1}{6} \int (a+a \cos (c+d x)) \left (6 a^3 (4 A+B)+15 a^3 (A+2 B) \cos (c+d x)\right ) \sec (c+d x) \, dx\\ &=-\frac {(3 A-B) \left (a^2+a^2 \cos (c+d x)\right )^2 \sin (c+d x)}{3 d}-\frac {(3 A-8 B) \left (a^4+a^4 \cos (c+d x)\right ) \sin (c+d x)}{6 d}+\frac {a A (a+a \cos (c+d x))^3 \tan (c+d x)}{d}+\frac {1}{6} \int \left (6 a^4 (4 A+B)+\left (6 a^4 (4 A+B)+15 a^4 (A+2 B)\right ) \cos (c+d x)+15 a^4 (A+2 B) \cos ^2(c+d x)\right ) \sec (c+d x) \, dx\\ &=\frac {5 a^4 (A+2 B) \sin (c+d x)}{2 d}-\frac {(3 A-B) \left (a^2+a^2 \cos (c+d x)\right )^2 \sin (c+d x)}{3 d}-\frac {(3 A-8 B) \left (a^4+a^4 \cos (c+d x)\right ) \sin (c+d x)}{6 d}+\frac {a A (a+a \cos (c+d x))^3 \tan (c+d x)}{d}+\frac {1}{6} \int \left (6 a^4 (4 A+B)+3 a^4 (13 A+12 B) \cos (c+d x)\right ) \sec (c+d x) \, dx\\ &=\frac {1}{2} a^4 (13 A+12 B) x+\frac {5 a^4 (A+2 B) \sin (c+d x)}{2 d}-\frac {(3 A-B) \left (a^2+a^2 \cos (c+d x)\right )^2 \sin (c+d x)}{3 d}-\frac {(3 A-8 B) \left (a^4+a^4 \cos (c+d x)\right ) \sin (c+d x)}{6 d}+\frac {a A (a+a \cos (c+d x))^3 \tan (c+d x)}{d}+\left (a^4 (4 A+B)\right ) \int \sec (c+d x) \, dx\\ &=\frac {1}{2} a^4 (13 A+12 B) x+\frac {a^4 (4 A+B) \tanh ^{-1}(\sin (c+d x))}{d}+\frac {5 a^4 (A+2 B) \sin (c+d x)}{2 d}-\frac {(3 A-B) \left (a^2+a^2 \cos (c+d x)\right )^2 \sin (c+d x)}{3 d}-\frac {(3 A-8 B) \left (a^4+a^4 \cos (c+d x)\right ) \sin (c+d x)}{6 d}+\frac {a A (a+a \cos (c+d x))^3 \tan (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 1.71, size = 312, normalized size = 2.08 \[ \frac {1}{192} a^4 (\cos (c+d x)+1)^4 \sec ^8\left (\frac {1}{2} (c+d x)\right ) \left (\frac {3 (16 A+27 B) \sin (c) \cos (d x)}{d}+\frac {3 (A+4 B) \sin (2 c) \cos (2 d x)}{d}+\frac {3 (16 A+27 B) \cos (c) \sin (d x)}{d}+\frac {3 (A+4 B) \cos (2 c) \sin (2 d x)}{d}-\frac {12 (4 A+B) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {12 (4 A+B) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {12 A \sin \left (\frac {d x}{2}\right )}{d \left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}+\frac {12 A \sin \left (\frac {d x}{2}\right )}{d \left (\sin \left (\frac {c}{2}\right )+\cos \left (\frac {c}{2}\right )\right ) \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )}+78 A x+\frac {B \sin (3 c) \cos (3 d x)}{d}+\frac {B \cos (3 c) \sin (3 d x)}{d}+72 B x\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.95, size = 150, normalized size = 1.00 \[ \frac {3 \, {\left (13 \, A + 12 \, B\right )} a^{4} d x \cos \left (d x + c\right ) + 3 \, {\left (4 \, A + B\right )} a^{4} \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (4 \, A + B\right )} a^{4} \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + {\left (2 \, B a^{4} \cos \left (d x + c\right )^{3} + 3 \, {\left (A + 4 \, B\right )} a^{4} \cos \left (d x + c\right )^{2} + 8 \, {\left (3 \, A + 5 \, B\right )} a^{4} \cos \left (d x + c\right ) + 6 \, A a^{4}\right )} \sin \left (d x + c\right )}{6 \, d \cos \left (d x + c\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.89, size = 226, normalized size = 1.51 \[ -\frac {\frac {12 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1} - 3 \, {\left (13 \, A a^{4} + 12 \, B a^{4}\right )} {\left (d x + c\right )} - 6 \, {\left (4 \, A a^{4} + B a^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) + 6 \, {\left (4 \, A a^{4} + B a^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (21 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 30 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 48 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 76 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 27 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 54 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3}}}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.16, size = 190, normalized size = 1.27 \[ \frac {A \,a^{4} \cos \left (d x +c \right ) \sin \left (d x +c \right )}{2 d}+\frac {13 A \,a^{4} x}{2}+\frac {13 A \,a^{4} c}{2 d}+\frac {B \sin \left (d x +c \right ) \left (\cos ^{2}\left (d x +c \right )\right ) a^{4}}{3 d}+\frac {20 a^{4} B \sin \left (d x +c \right )}{3 d}+\frac {4 A \,a^{4} \sin \left (d x +c \right )}{d}+\frac {2 a^{4} B \cos \left (d x +c \right ) \sin \left (d x +c \right )}{d}+6 a^{4} B x +\frac {6 a^{4} B c}{d}+\frac {4 A \,a^{4} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {A \,a^{4} \tan \left (d x +c \right )}{d}+\frac {a^{4} B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.40, size = 187, normalized size = 1.25 \[ \frac {3 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a^{4} + 72 \, {\left (d x + c\right )} A a^{4} - 4 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} B a^{4} + 12 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B a^{4} + 48 \, {\left (d x + c\right )} B a^{4} + 24 \, A a^{4} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 6 \, B a^{4} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 48 \, A a^{4} \sin \left (d x + c\right ) + 72 \, B a^{4} \sin \left (d x + c\right ) + 12 \, A a^{4} \tan \left (d x + c\right )}{12 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.42, size = 242, normalized size = 1.61 \[ \frac {4\,A\,a^4\,\sin \left (c+d\,x\right )}{d}+\frac {20\,B\,a^4\,\sin \left (c+d\,x\right )}{3\,d}+\frac {13\,A\,a^4\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {8\,A\,a^4\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {12\,B\,a^4\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,B\,a^4\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {A\,a^4\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )}+\frac {B\,a^4\,{\cos \left (c+d\,x\right )}^2\,\sin \left (c+d\,x\right )}{3\,d}+\frac {A\,a^4\,\cos \left (c+d\,x\right )\,\sin \left (c+d\,x\right )}{2\,d}+\frac {2\,B\,a^4\,\cos \left (c+d\,x\right )\,\sin \left (c+d\,x\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________